<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript" src="../ui/jquery.min.js"></script>
    <script type="text/javascript" src="../ui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../ui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../ui/highcharts.js"></script>
    <script type="text/javascript" src="../ui/jquery.serializejson.min.js"></script>
    <script>
        $.contextPath = "<%=basePath%>";

        var self = this;
        this.showwc=function(){
            $.ajax({
                url: '${pageContext.request.contextPath}/waveCurveFile/getWave',
                dataType: 'json',
                type: 'post',
                success: function (res) {
                    debugger
                    self.showPic(res);
                }
            })
        }

        this.showPic = function (data) {
            var $div = $("#d1");
            debugger
            var height = $div.height();
            var width = $div.width();
            $div.highcharts({
                chart: {
                    height: height - 10,
                    width: width - 10
                },
                legend: {
                    layout: 'vertical',
                    align: 'right',
                    verticalAlign: 'middle'
                },
                plotOptions: {
                    series: {
                        label: {
                            connectorAllowed: false
                        },
                        pointStart: 1
                    }
                },
                yAxis: {  //y轴
                    title: {
                        text: '曲线数据'
                    }

                },
                series: [{
                    name: "波形",
                    data: data
                }]
            });
        }

    </script>

</head>
<body>
   <div id="d1" style="width: 100%;height: 600px;"></div>

<button onclick="showwc()">123456</button>
</body>
</html>
